package model.type;

import java.util.HashMap;

import db.EntPerRelationTypeDAO;
import db.ImbiConnection;

public class EntPerRelationType {
	private static HashMap<Integer, EntPerRelationType> map 
	= new HashMap<Integer, EntPerRelationType>();
	
	private int id;
	private String type;	
	//TODO This type can dynamically change
	// LOAD EVERYTHING INTO HASHMAP FOR QUICK REFERENECE IN THE FUTURE
	static{
		
		for(EntPerRelationType t: ImbiConnection.getEntPerRelationTypeDAO().findAll()){
			map.put(t.getId(), t);
		}
		
	}
	
	public static EntPerRelationType getEntPerRelationType(int id){
		return map.get(id);
	}
	
	public EntPerRelationType(int id, String type) {
		this.id = id;
		this.type = type;
	}
	
	public int getId() {
		return id;
	}

	public String getType() {
		return type;
	}
}
